<?php
    
    namespace App\Module\Api\Validator;
    use App\System\Base\Validator\BaseValidator;

    /**
     * 定义验证器类
     * @author liujun
     */
    class PaySubmitValidator extends BaseValidator
    {
        protected $rules = [
            'q.a' => 'required|integer|between:1,2',
            'q.id' => 'required_if:q.a,2|integer',
            'q.cash' => 'required_if:q.a,1|integer',
            'q.payType' => 'required|integer|between:1,3',
            'q.payPassword' => 'required_if:q.payType,3',

        ];
        
        protected $messages = [

        ];

        protected $attributes = [
            'q.a' => '请求类型a',
            'q.id' => '订单ID',
            'q.cash' => '金额',
            'q.payType' => '支付方式',
            'q.payPassword' => '支付密码'
        ];
    }